package cn.weekimwee.firstlineofcodeforkotlin.unit12

import android.content.Context
import cn.weekimwee.firstlineofcodeforkotlin.GlideApp
import cn.weekimwee.firstlineofcodeforkotlin.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

/**
 * Created by Wee Kim Wee on 2018/4/11.
 */
class AdapterFruit(var context: Context, data:MutableList<Fruit>?):BaseQuickAdapter<Fruit,BaseViewHolder>(R.layout.item_fruit,data){
    override fun convert(helper: BaseViewHolder?, item: Fruit?) {
        helper?.setText(R.id.fruit_name,item?.name)
        GlideApp.with(context).load(item?.imageId).into(helper?.getView(R.id.fruit_image))
    }

}